By default this is only done during the install step, because gtk-doc
is relatively slow and cannot tell Meson how its dependency tree looks.
However, for GTK that breaks some dependency tracking, leading to
required Docbook files not being generated from their Markdown source.
override_dh_auto_build:
dh_auto_build --builddirectory=debian/build/deb
+ifneq ($(filter %-doc,$(built_binaries)),)
+ # Explicitly build the documentation: otherwise it's done as a
+ # side-effect of the install step, which doesn't respect the
+ # dependencies that generate Docbook files from markdown.
+ # https://github.com/mesonbuild/meson/issues/1844
+ # https://github.com/mesonbuild/meson/issues/5793
+ dh_auto_build --builddirectory=debian/build/deb -- gdk4-doc gsk4-doc gtk4-doc
+endif
ifneq ($(filter %-udeb,$(built_binaries)),)
dh_auto_build --builddirectory=debian/build/udeb
endif